package com.gage.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.gage.commons.result.PageInfo;
import com.gage.mapper.BsFinanceMapper;
import com.gage.model.BsFinance;
import com.gage.service.IBsFinanceService;
@Service
public class BsFinanceServiceImpl extends ServiceImpl<BsFinanceMapper, BsFinance> implements IBsFinanceService{
	@Autowired
	private BsFinanceMapper financeMapper;
	@Override
	public PageInfo selectDataGrid(PageInfo pageInfo) {
		 Page<Map<String, Object>> page = new Page<Map<String, Object>>(pageInfo.getNowpage(), pageInfo.getSize());
	        page.setOrderByField(pageInfo.getSort());
	        page.setAsc(pageInfo.getOrder().equalsIgnoreCase("asc"));
	        List<Map<String, Object>> list = financeMapper.selectBsFinanceByKeyword(page, pageInfo.getCondition());
	        pageInfo.setRows(list);
	        pageInfo.setTotal(page.getTotal());
	        return pageInfo;
	}
}
